<template>
  <div>
    <child />
    <h1>{{ obj.name }}=={{ obj.age }}</h1>
    <button @click="add">添加年龄</button>
    <button @click="plus">年龄++</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      obj: {
        name: "小明",
      },
    };
  },
  methods: {
    add() {
      this.$set(this.obj, "age", 18);
      //   this.obj.age = 18;
    },
    plus() {
      this.obj.age++;
    },
  },
  created() {},
  mounted() {},
  components: {},
  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped></style>
